package cashin

class ReceiptLine {

    BigDecimal discount=0
    static hasOne = [item:Item]
    Double receiptLinePrice //= item.sellingPrice
    BigDecimal plus(ReceiptLine other) {
        receiptLinePrice*(1-discount/100) + other.receiptLinePrice*(1-other.discount/100)
    }


    static belongsTo = [Receipt]
    static constraints = {

        discount(min: 0, max: 100)

    }
}
